$(function () {
    $('table.data-table.sort').dataTable({
        "bPaginate": false,
        "bLengthChange": false,
        "bFilter": false,
        "bSort": true,
        "bInfo": false,
        "bAutoWidth": false
    });
    $('table.data-table.full').dataTable({
        "bPaginate": true,
        "bLengthChange": true,
        "bFilter": true,
        "bSort": true,
        "bInfo": true,
        "bAutoWidth": true,
        "sPaginationType": "full_numbers",
        "sDom": '<""f>t<"F"lp>',
        "sPaginationType": "bootstrap"
    });
});
function toggleMainMenuSetting() {
    if (document.getElementById("main_menu_setting").style.maxHeight != '500px') {
        document.getElementById("main_menu_setting").style.maxHeight = '500px';
    } else {
        document.getElementById("main_menu_setting").style.maxHeight = '0';
    }
}
function toggleMainMenuMember() {
    if (document.getElementById("main_menu_member").style.maxHeight != '500px') {
        document.getElementById("main_menu_member").style.maxHeight = '500px';
    } else {
        document.getElementById("main_menu_member").style.maxHeight = '0';
    }
}
function toggleMainMenuTuyenSinh() {
    if (document.getElementById("main_menu_tuyen_sinh").style.maxHeight != '500px') {
        document.getElementById("main_menu_tuyen_sinh").style.maxHeight = '500px';
    } else {
        document.getElementById("main_menu_tuyen_sinh").style.maxHeight = '0';
    }
}
function toggleMainMenuThuChi() {
    if (document.getElementById("main_menu_thu_chi").style.maxHeight != '500px') {
        document.getElementById("main_menu_thu_chi").style.maxHeight = '500px';
    } else {
        document.getElementById("main_menu_thu_chi").style.maxHeight = '0';
    }
}
function toggleMainMenuQuanLyHoc() {
    if (document.getElementById("main_menu_quan_ly_hoc").style.maxHeight != '500px') {
        document.getElementById("main_menu_quan_ly_hoc").style.maxHeight = '500px';
    } else {
        document.getElementById("main_menu_quan_ly_hoc").style.maxHeight = '0';
    }
}
function toggleMainMenuHoc() {
    if (document.getElementById("main_menu_hoc").style.maxHeight != '500px') {
        document.getElementById("main_menu_hoc").style.maxHeight = '500px';
    } else {
        document.getElementById("main_menu_hoc").style.maxHeight = '0';
    }
}
function toggleMainMenuLocation() {
    if (document.getElementById("main_menu_location").style.maxHeight != '500px') {
        document.getElementById("main_menu_location").style.maxHeight = '500px';
    } else {
        document.getElementById("main_menu_location").style.maxHeight = '0';
    }
}
function toggleLeftMainMenu() {
    if (document.getElementById("left_main_menu").style.left != '-16%') {
        document.getElementById("left_main_menu").style.left = '-16%';
        document.getElementById("btn_hide_main_menu").style.left = '0%';
        document.getElementById("main_content").style.width = '99%';
        document.getElementById("main_content").style.marginLeft = '0%';
        document.getElementById("left_main_menu").style.minWidth = '0';
        document.getElementById("left_main_menu").style.overflow = 'hidden';
    } else {
        document.getElementById("left_main_menu").style.left = '0%';
        document.getElementById("btn_hide_main_menu").style.left = '14%';
        document.getElementById("main_content").style.width = '84.9%';
        document.getElementById("main_content").style.marginLeft = '15%';
        document.getElementById("left_main_menu").style.minWidth = '152px';
        document.getElementById("left_main_menu").style.overflow = 'visible';
    }
}
var btnDelete = document.getElementById('btn-delete');
//delete popup
function commonDelete() {
    var message = 'Are you sure you want to delete this item?';
    if (confirm(message)) {
        // delete something...
    }
}

function popup() {
    var pu = document.getElementById("popup_lich"),
    dimmer = document.createElement("div");
    dimmer.style.width = 100 + '%';
    dimmer.style.height = 100 + '%';
    dimmer.className = 'dimmer';
    dimmer.onclick = function () {
        document.body.removeChild(this);
        pu.style.visibility = 'hidden';
    }
    document.body.appendChild(dimmer);
    pu.style.visibility = 'visible';
    pu.style.top = 15 + '%';
    pu.style.left = 10 + '%';
}